﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using nsDalLayer;
using System.Data;
public partial class WebControls_Group : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       // GroupDetail();
    }
    clsGroup group;
    clsGroupPRP groupPrp;
    private void GroupDetail()
    {
       group = new clsGroup();
        DataSet ds = new DataSet();
        var a= group.LastInserted_Group();

        grdGroupDetial.DataSource = a;
        grdGroupDetial.DataBind();
 
    }
    private void GroupListBind()
    {
        group = new clsGroup();
        DataSet ds = new DataSet();

    }
    protected void addGroup_Click(object sender, EventArgs e)
    {
        try
        {
            group = new clsGroup();
            groupPrp = new clsGroupPRP();
            groupPrp.Group_MainCatID = 1;
            groupPrp.GroupTitle = txtGroupTitle.Text;
            groupPrp.GroupDsc = txtGroupDsc.Text;
            string file = "~/ImagePath/" + ImageUploder.FileName;
            string dataFile = "../ImagePath/" + ImageUploder.FileName;
            ImageUploder.SaveAs(Server.MapPath(file));
            groupPrp.GroupThumbPath = dataFile;
            groupPrp.GroupImagePath = dataFile;
            group.save_rec(groupPrp);
            GroupDetail();

        }
        catch(Exception ex)
        {
     
        }

    }
}